package com.example.jiemian;

import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;

public class MainActivity extends AppCompatActivity {
    private Handler handler;

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);//设置窗体无标题
        //设置全屏
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,//最大宽度显示
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        //启动页面

        setContentView(R.layout.activity_main);

        //跳转
        staterActivity();
    }

    public void staterActivity() {

        handler = new Handler();
        handler.postDelayed(new Runnable() {
            //post两个参数，线程与时间
            public void run() {
                Intent intent = new Intent(MainActivity.this, loginActivity.class);
                //新的activity
                startActivity(intent);
                //关闭activity
                finish();
            }
        }, 500);
    }
}
